package com.woniuxy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.entity.DTO.DeliveryDTO;
import com.woniuxy.mapper.DeliveryMapper;
import com.woniuxy.service.DeliveryService;
import com.woniuxy.util.PageParam;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class DeliveryServiceImpl implements DeliveryService {
    @Resource
    private DeliveryMapper deliveryMapper;
    @Override
    public PageInfo queryAllInfo(PageParam<DeliveryDTO> pageParam) {
        PageHelper.startPage(pageParam.getPageNum(),pageParam.getPageSize());
        List<DeliveryDTO> deliveryDTOS = deliveryMapper.queryAllInfo(pageParam.getParam());
        PageInfo<DeliveryDTO> deliveryDTOPageInfo = new PageInfo<>(deliveryDTOS);
        return deliveryDTOPageInfo;
    }
}
